import java.util.Scanner;

public class OddEvenBinary {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for (int i = 30; i >= 0; i -= 2) System.out.print((input >> i) & 1);
        System.out.println();
        for (int i = 31; i >= 0; i -= 2) System.out.print((input >> i) & 1);
    }
}
